export default{
    name:'power',
    mounted(el,binding, vnode){
        if (admin==undefined || admin.user==undefined)  return;

        let power = '';
        
        if (binding.value) {
            power = binding.value;
        }else{
            const {arg,modifiers} = binding;

            if (arg==undefined){
                
            } // console.log('power arg is null');
            else{
                
                power += arg;
            }

            Object.keys(modifiers).forEach((name)=>{
                power +='.' + name;
            });
        }
        

        if (power!='' && !admin.user.power(power)) {
            el.parentNode.removeChild(el);
        }
    }
}